<extend name="Member/base" />
<block name="js">
	<link rel='stylesheet' type='text/css' href='/Public/static/kcs/kcs.css?v={:C('URL_VERSION')}'>
	<script src='/Public/static/kcs/kcs.src.js?v={:C('URL_VERSION')}'></script>
	<script src='/Public/static/kcs/kcs.js?v={:C('URL_VERSION')}'></script>
	<script src="/Public/static/uploadify/jquery.uploadify.min.js?v={:C('URL_VERSION')}"></script>
</block>
<block name="main">
<!--body-->
<div class="kUi_content KUi_usercenter">
	<div class="row warp">
		<div class="usern-block">
			<include file="Member/leftnavi" />
			<div class="usern-main usern-main-noinof">
				<div class="main-block">
					<empty name="Category">
					<div>您还未获得发布文章的授权，请联系管理员开通权限！</div>
					<else />
					<form id="article-from" method="post" action="">
						<div class="add-article">
							<div class="box-body">
								<div class="from-group">
									<label class="control-label">分类：</label>
									<div class="r-control" style="padding-top:7px;">
										<span>{$info.category_id|get_category_title}</span>
									</div>
								</div>
								<div class="from-group">
									<label class="control-label">标题：</label>
									<div class="r-control">
										<input name="title" type="text" id="inputTextArea1" class="forms-control" value="{$info.title}"/>
									</div>
								</div>
								<div class="from-group">
									<label class="control-label">描述：</label>
									<div class="r-control">
										<textarea class="forms-control" id="inputTextArea2" placeholder="描述内容" name="description">{$info.description}</textarea>
									</div>
								</div>
								<div id="fengmian" class="from-group">
									<label for="upload_picture_cover_id" class="control-label">封面：</label>
									<div class="r-control">
										<input type="hidden" class="kcsupload" name="cover_id" value="{$info.cover_id|get_cover='path'}" data-src="{$info.cover_id|get_cover='path'}" />
									</div>
								</div>
								<div class="from-group">
									<label class="control-label">文章内容：</label>
									<div class="r-control">
										<textarea class="textarea form-control" name="content" placeholder="Place some text here" style="min-height:164px">{$info.content}</textarea>
										<?php $GLOBALS['uploadAddonsUrl'] = addons_url("EditorForAdmin://Uploadhome/ke_upimg");?>
										{:hook('adminArticleEdit', array('name'=>content,'value'=>$info.content))}
									</div>
								</div>
								<!--
								<div class="from-group">
									<label class="control-label">外部商品链接：</label>
									<div class="r-control">
										<input name="link_id" type="text" id="inputTextArea3" class="forms-control" value="{$info.link_id}"/>
									</div>
								</div>
								-->
							</div>
							<div class="article-save">
								<button id="j_save_button" class="btns btn-success btn-flat">保存</button>
								<button class="btns btn-default btn-flat" onclick="avascript:history.back();">取消</button>
							</div>
						</div>
					</form>
					</empty>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$('#j_save_button').click(function() {
			$('#article-from').submit();
            return false;
        });
	})
</script>
<script>
var initUploader = function(){
		var el = $(this);
		KCS.uploader(el,{
					type:'image',
					width:'200',
					height:'120',
					url:'{:U('upload')}'
		});
	};
	$('.kcsupload').each(initUploader);
</script>
</block>
